<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>四川省工程建设领域项目信息、信用管理维护平台</title>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/css/reset.css" />
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

html,body {
	height: 100%;
	overflow: hidden;
	font: 12px/ 1.5 simsun;
}

.myPage {
	line-height: 3;
	overflow: auto;
	width: 100%;
	height: 100%;
}

.lightBox,.popupCover,.popupIframe,.popupComponent {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

.popupComponent {
	z-index: 2;
	display: none;
}

.popupIframe {
	display: none;
	_display: block;
	_filter: alpha(opacity =   0);
}

.popupCover {
	background: #000;
	opacity: 0.5; *
	filter: alpha(opacity =   70);
}

.lightBox {
	text-align: center;
	overflow: auto;
}

.lightBoxContent {
	display: inline-block; *
	display: inline;
	zoom: 1;
	width: 500px;
	padding: 10px;
	background: #fff;
	border: 5px solid #00b4ff;
	vertical-align: middle;
}

.lightBoxMaxHeight {
	display: inline-block;
	vertical-align: middle;
	height: 100%; *
	height: 99.5%;
	width: 1px;
	overflow: hidden;
	margin-left: -1px;
}

.lightBoxWrapper {
	display: inline-block; *
	display: inline;
	zoom: 1;
	text-align: center;
}

.lightBoxClose {
	color: #f00;
}

.lightBoxSubmit {
	margin-top: 10px;
	padding-top: 5px;
	border-top: 1px solid #ccc;
}

.lightBoxSubmit input {
	font-size: 12px;
	padding: 0 10px;
	overflow: visible;
	margin: 0 5px;
}
</style>
<script src="<%=request.getContextPath()%>/scripts/jquery.pack.js"></script>
<script type="text/javascript">
function check(formname){
	
	var f = document.getElementById(formname);
	if (f.account.value == ""){
		alert("必须填写帐号");
		f.account.focus();
		return false;
	}
	if (f.userPwd.value == ""){
		alert("必须填写密码");
		f.userPwd.focus();
		return false;
	}
	//if (f.carId.value == "" ){ //|| f.carId.value.length != 11
	//	alert("必须填写有效身份证号码");
	//	f.carId.focus();
	//	return false;
	//}
	if (f.authCode.value == ""){
		alert("必须填写验证码");
		f.authCode.focus();
		return false;
	}
	
	$.ajax({
		   type: "POST",
		   url: "<%=request.getContextPath()%>/user/loginAuth",
		   data: "account="+f.account.value+"&userPwd="+f.userPwd.value+"&authCode="+f.authCode.value,
		   success: function(message){
			   //兼容IE和FIREFOX的触发authCodeImg.click()事件
			   if(document.all){ 
					document.getElementById('authCodeImg').click();
			   }else{ 
			   		var evt = document.createEvent("MouseEvents"); 
			   		evt.initEvent("click", true, true); 
			   		document.getElementById('authCodeImg').dispatchEvent(evt); 
			   } 

				var obj = eval('('+message+')');
				
				if(obj.msg=="error"){
					document.getElementById('lightBox').style.display = "block";
					return;
				}else{
					location.href = '<%=request.getContextPath()%>'+obj.msg;
				}
							   
		   }
	});
	
}
//弹窗DIV控制JS
function showLayer(id) {
	document.getElementById(id).style.display = "block";
}
function hideLayer(id) {
	document.getElementById(id).style.display = "none";
}

function newWindow(url){
	window.open(url, '');
}
</script>
</head>

<body class="logbg">
<% String account = com.cdxy.util.http.CookieUtil.getCookieValue(request, "ac");
   if (account == null) {
	   account="";
   }else{
	   account = java.net.URLDecoder.decode(com.cdxy.util.http.CookieUtil.getCookieValue(request, "ac"),"UTF-8");
   }
  
						
%>
<div class="logform">
<form id=form1 method=post
	action="<%=request.getContextPath()%>/user/loginAuth">
<table class="logintable">
	<tbody>
		<tr>
			<th colspan="2"></th>
		</tr>
		<tr>
			<td align="right">用户名：</td>
			<td class="pt-25px"><input type="text" id="account"
				name="account" class="intt" value="<%=account%>"
				onkeypress="if(event.keyCode==13) {check('form1');return false;}" /></td>
		</tr>
		<tr>
			<td align="right">密码：</td>
			<td><input id="userPwd" type="password" name="userPwd"
				class="intt"
				onkeypress="if(event.keyCode==13) {check('form1');return false;}" /></td>
		</tr>
		<tr>
			<td align="right">验证码：</td>
			<td><input type="text" class="intt" style="width: 60px"
				id="authCode" name="authCode"
				onkeypress="if(event.keyCode==13) {check('form1');return false;}" />
			<img id="authCodeImg"
				style="height: 20px; margin: 0 0 4px 3px; cursor: hand;"
				src="<%=request.getContextPath()%>/servlet/auth/image.jpg"
				onclick="this.src='<%=request.getContextPath()%>/servlet/auth/image.jpg?'+Math.random();"
				alt="点击换一张" /></td>
		</tr>
		<tr>
			<td></td>
			<td><input type="button" value=" 登 录 " id="submit"
				class="btngreen" onClick="check('form1');" /><b>&nbsp;&nbsp;<a
				href="javascript:newWindow('postpwd.jsp')">找回密码</a></b><b><a
				href="reg.jsp">用户注册</a></b></td>
		</tr>
	</tbody>
</table>
</form>
<!-- 错误弹窗DIV开始 -->
<div class="popupComponent" id="lightBox"><iframe
	class="popupIframe"></iframe>
<div class="popupCover"></div>
<div class="lightBox"><span class="lightBoxMaxHeight"></span>
<div class="lightBoxContent">
<div class="lightBoxWrapper"><img
	src="<%=request.getContextPath()%>/images/loginerror.jpg" alt="出现错误啦" /><br />
</div>
<div class="lightBoxSubmit"><input type="button" value="确定"
	onclick="hideLayer('lightBox')" /></div>
</div>
</div>
</div>
<!-- 错误弹窗DIV结束  -->
<div class="footer">
<div style="margin: 0 auto;" align="center">
<table>
	<tr>
		<td colspan="6">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="3" align="right">主办单位：</td>
		<td colspan="3" align="left">四川省工程建设领域突出问题工作领导小组办公室</td>
	</tr>
	<tr>
		<td colspan="3"></td>
		<td colspan="3" align="left">四川省工程建设领域项目信息公开和诚信体系建设协调小组办公室</td>
	</tr>
	<tr>
		<td colspan="3" align="right">技术支持：</td>
		<td colspan="3" align="left">四川高软软件科技有限公司</td>
	</tr>
	<tr>
		<td colspan="6" align="left">咨询电话：18080875888&nbsp;&nbsp;&nbsp;&nbsp;技术支持电话：18080090990</td>
	</tr>
</table>
<p align="center" >蜀ICP备11006040号-1</p>
</div>
</div>
</div>
</body>
</html>
